FROM maven:3-jdk-8 as appserver
WORKDIR /usr/app
COPY pom.xml .
COPY src src
RUN mvn package -DskipTests

FROM java:8-jdk-alpine
WORKDIR /app
COPY --from=appserver /usr/app/target/spring-security-jwt-1.0-SNAPSHOT.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]